<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>物业钱包充值</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript" src="${ctxStatic}/supcan/ajaxSet.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#openingBank").focus();
			$("#inputForm").validate({
				rules: {
				},
				messages: {
					newBankCardNo: {equalTo: "输入与上面相同的卡号"}
				},
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
	<script>
		function isPhone(obj){
			var phone=obj.value;
			$.ajax({
				type : "POST",
				url : "${ctx}/sys/tbShopProduct/phoneToNickName",
				data : {
					phone : phone
				},
				dataType : "JSON",
				success : function(date) {
					if (date.length > 0) {
						for (var i = 0; i < date.length; i++) {
							var item = date[i];
							$("#uid").val(item.uid);
							//alert($("#uid"));
							document.getElementById("nik").innerHTML=item.nickName;
						}

					}
				}

			});
		}

	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sys/tbShopProduct/AddTenementWallet">物业钱包充值</a></li>
	</ul><br/>
	<span><font style="color: #00A6C7">${message}</font></span>
	<form:form id="inputForm" modelAttribute="tbUser" action="${ctx}/sys/tbShopProduct/AddTenementWallet" method="post" class="form-horizontal">
		<form:hidden path="uid" id="uid"/>
		<sys:message content="${message}"/>
		<span><font style="color: #00A6C7">${message1}</font></span>
		<div class="control-group">
			<label class="control-label">手机:</label>
			<div class="controls">
				<form:input path="mobile" htmlEscape="false" maxlength="100" class="phone" onblur="isPhone(this)"/><font color="red">*</font>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">昵称:</label>
			<div class="controls">
				<span class="help-inline"><font id="nik">${tbUser.address}</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">充值金额:</label>
			<div class="controls">
				<input id="mqtotalMoney" name="mqtotalMoney" type="number" min="0"  maxlength="10"  class="required" value="${tbUser.mqtotalMoney}" />
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="form-actions">
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>